#!/usr/bin/perl

use strict;
use warnings;
use Config::ApacheFormat;

#handle possible config file from positional parameters
my $configpath;
if ( $#ARGV == 0 )
{
	if ( -e $ARGV[0] && -R $ARGV[0] )
	{
		$configpath = $ARGV[0];
	}
	else
	{
		die( "Config path error\n" );
	}
}
else
{
	$configpath = 'local';
}

my $config = Config::ApacheFormat->new();
eval
{
	$config->read( $configpath );
	my @interfaces = $config->get( "interface" );
};
if ( $@ )
{
	print $@;
	die( "Exception Caught" );
};
